<div class="panel panel-default">
	<div class="panel-heading">&{'weixin.reply.caption'}</div>
	<div class="panel-body">
		<form id="reply-data-form" name="replyForm" action="#" method="post" class="form-horizontal form-wx" novalidate>
			<!-- name -->
			<div class="form-group" ng-class="hasError(replyForm.name)">
				<label for="name" class="col-sm-2 control-label"><strong>*</strong>&{'weixin.reply.name'}</label>
				<div class="col-sm-4">
					<input name="name" type="text" class="form-control" autofocus ng-model="reply.name" required>
					<p class="help-block fade-animate" ng-if="isError(replyForm.name, 'required')"><i class="fa fa-exclamation-triangle"></i> &{'weixin.reply.name.failure.required'}</p>
				</div>
			</div>
			<!-- /name -->
			
			<!-- keyword -->
			<div class="form-group">
				<label for="type" class="col-sm-2 control-label">&{'weixin.reply.keywords'}</label>
				<div class="col-sm-3">
					<div class="input-group">
						<input name="keyword" type="text" class="form-control" ng-model="reply.keyword">
						<span class="input-group-btn">
							<button type="button" class="btn btn-default" ng-click="addKeyword()">&{'app.common.button.add'}</button>
						</span>
					</div>
					<p class="help-block"><i class="fa fa-info-circle fa-fw"></i>&{'weixin.reply.notice.2'}</p>
				</div>
			</div>
			
			<div class="form-group" ng-if="!empty(keywords)">
				<div class="col-sm-4 col-sm-offset-2">
					<div class="row fade-animate" style="border-bottom:1px solid #ccc" ng-repeat="keyword in keywords">
						<div class="col-sm-8 form-control-static">{{keyword.name}}</div>
						<div class="col-sm-3 checkbox"><label><input name="keyword_{{keyword.name}}" type="checkbox" ng-model="keyword.checked">&{'weixin.reply.partial.matching'}</label></div>
						<div class="col-sm-1"><button type="button" class="btn btn-link" ng-click="delKeyword(keyword)"><i class="fa fa-times"></i></button></div>
					</div>
				</div>
			</div>
			<!-- /keyword -->
			
			<!-- type -->
			<div class="form-group" ng-class="hasError(replyForm.type)">
				<label for="type" class="col-sm-2 control-label"><strong>*</strong>&{'weixin.reply.type'}</label>
				<div class="col-sm-10 radio">
					#{list items: types, as: 't'}
					<label><input name="type" value="${t.key}" type="radio" ng-model="reply.type" required>${t.value}</label>
					#{/list}
				</div>
			</div>
			<!-- /type -->
			
			<!-- value -->
			<div class="form-group fade-animate" ng-if="reply.type==='01'" ng-class="hasError(replyForm.value)">
				<label class="col-sm-2 control-label">&{'resource.type.text'}</label>
				<div class="col-sm-6">
					<textarea name="value" rows="5" class="form-control" ng-model="reply.value" required></textarea>
				</div>
			</div>
			
			<div class="form-group fade-animate" ng-if="reply.type==='02'">
				<label class="col-sm-2 control-label">&{'resource.type.single'}</label>
				<div class="col-sm-10">
					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-popover" ng-click="modal('@{Resources.article_popover('02', 'setArticle')}')">&{'resource.button.single'}</button>
					<div class="fade-animate single" ng-if="article" article="article" autoheight></div>
				</div>
			</div>
			
			<div class="form-group fade-animate" ng-if="reply.type==='03'">
				<label class="col-sm-2 control-label">&{'resource.type.multi'}</label>
				<div class="col-sm-10">
					<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-popover" ng-click="modal('@{Resources.article_popover('03', 'setArticle')}')">&{'resource.button.multi'}</button>
					<div class="fade-animate single" ng-if="article_multi" article-multi="article_multi"></div>
				</div>
			</div>
			<!-- /value -->
			
			<!-- button & hidden -->
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="button" class="btn btn-success" ng-click="save()" ng-disabled="btnDisabled(replyForm)">
						<span ng-if="btn(['wait'])">&{'app.common.button.save'}</span>
						<span ng-if="btn(['doing'])"><i class="fa fa-spinner fa-spin"></i> &{'app.common.button.doing'}</span>
					</button>
					<button type="button" class="btn btn-default" ng-click="cancel()">&{'app.common.button.cancel'}</button>
				</div>
			</div>
			<!-- /button & hidden -->
		</form>
	</div>
</div>
